home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / New System Software Extensions / QuickDraw™ 3D 1.0 / Development / Interfaces / QD3DDrawContext.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-06-02  |  6.7 KB  |  234 lines  |  [TEXT/MPS ]

  1. /******************************************************************************
  2.  **                                                                             **
  3.  **     Module:        QD3DDrawContext.h                                         **
  4.  **                                                                          **
  5.  **                                                                          **
  6.  **     Purpose:    Draw context class types and routines                        **
  7.  **                                                                          **
  8.  **                                                                          **
  9.  **                                                                          **
  10.  **     Copyright (C) 1993-1995 Apple Computer, Inc. All rights reserved.     **
  11.  **                                                                          **
  12.  **                                                                          **
  13.  *****************************************************************************/
  14. #ifndef QD3DDrawContext_h
  15. #define QD3DDrawContext_h
  16.  
  17. #ifndef QD3D_h
  18. #include "QD3D.h"
  19. #endif  /*  QD3D_h  */
  20.  
  21. #if PRAGMA_ONCE
  22.     #pragma once
  23. #endif
  24.  
  25. #if defined(WINDOW_SYSTEM_MACINTOSH) && WINDOW_SYSTEM_MACINTOSH
  26. #include <Quickdraw.h>
  27. #include <FixMath.h>
  28. #include <graphics types.h>
  29. #endif  /*  WINDOW_SYSTEM_MACINTOSH  */
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif /*  __cplusplus  */
  34.  
  35.  
  36. /******************************************************************************
  37.  **                                                                             **
  38.  **                            DrawContext Data Structures                         **
  39.  **                                                                             **
  40.  *****************************************************************************/
  41.  
  42. typedef enum TQ3DrawContextClearImageMethod{
  43.     kQ3ClearMethodNone,
  44.     kQ3ClearMethodWithColor
  45. } TQ3DrawContextClearImageMethod;
  46.  
  47.  
  48. typedef struct TQ3DrawContextData {
  49.     TQ3DrawContextClearImageMethod    clearImageMethod;
  50.     TQ3ColorARGB                    clearImageColor;
  51.     TQ3Area                            pane;
  52.     TQ3Boolean                        paneState;
  53.     TQ3Bitmap                        mask;
  54.     TQ3Boolean                        maskState;
  55.     TQ3Boolean                        doubleBufferState;
  56. } TQ3DrawContextData;
  57.  
  58.  
  59. /******************************************************************************
  60.  **                                                                             **
  61.  **                                DrawContext Routines                         **
  62.  **                                                                             **
  63.  *****************************************************************************/
  64.  
  65. QD3D_EXPORT TQ3ObjectType Q3DrawContext_GetType(
  66.     TQ3DrawContextObject        drawContext);
  67.  
  68. QD3D_EXPORT TQ3Status Q3DrawContext_SetData(
  69.     TQ3DrawContextObject        context,
  70.     const TQ3DrawContextData    *contextData);
  71.  
  72. QD3D_EXPORT TQ3Status Q3DrawContext_GetData(
  73.     TQ3DrawContextObject        context,
  74.     TQ3DrawContextData            *contextData);
  75.     
  76. QD3D_EXPORT TQ3Status Q3DrawContext_SetClearImageColor(
  77.     TQ3DrawContextObject        context,
  78.     const TQ3ColorARGB             *color);
  79.  
  80. QD3D_EXPORT TQ3Status Q3DrawContext_GetClearImageColor(
  81.     TQ3DrawContextObject        context,
  82.     TQ3ColorARGB                 *color);
  83.  
  84. QD3D_EXPORT TQ3Status Q3DrawContext_SetPane(
  85.     TQ3DrawContextObject        context,
  86.     const TQ3Area                 *pane);
  87.  
  88. QD3D_EXPORT TQ3Status Q3DrawContext_GetPane(
  89.     TQ3DrawContextObject        context,
  90.     TQ3Area                         *pane);
  91.  
  92. QD3D_EXPORT TQ3Status Q3DrawContext_SetPaneState(
  93.     TQ3DrawContextObject        context,
  94.     TQ3Boolean                    state);
  95.  
  96. QD3D_EXPORT TQ3Status Q3DrawContext_GetPaneState(
  97.     TQ3DrawContextObject        context,
  98.     TQ3Boolean                    *state);
  99.         
  100. QD3D_EXPORT TQ3Status Q3DrawContext_SetClearImageMethod(
  101.     TQ3DrawContextObject            context,
  102.     TQ3DrawContextClearImageMethod     method);
  103.         
  104. QD3D_EXPORT TQ3Status Q3DrawContext_GetClearImageMethod(
  105.     TQ3DrawContextObject            context,
  106.     TQ3DrawContextClearImageMethod     *method);
  107.         
  108. QD3D_EXPORT TQ3Status Q3DrawContext_SetMask(
  109.     TQ3DrawContextObject        context,
  110.     const TQ3Bitmap                *mask);
  111.         
  112. QD3D_EXPORT TQ3Status Q3DrawContext_GetMask(
  113.     TQ3DrawContextObject        context,
  114.     TQ3Bitmap                    *mask);
  115.  
  116. QD3D_EXPORT TQ3Status Q3DrawContext_SetMaskState(
  117.     TQ3DrawContextObject        context,
  118.     TQ3Boolean                    state);
  119.  
  120. QD3D_EXPORT TQ3Status Q3DrawContext_GetMaskState(
  121.     TQ3DrawContextObject        context,
  122.     TQ3Boolean                    *state);
  123.  
  124. QD3D_EXPORT TQ3Status Q3DrawContext_SetDoubleBufferState(
  125.     TQ3DrawContextObject        context,
  126.     TQ3Boolean                     state);
  127.  
  128. QD3D_EXPORT TQ3Status Q3DrawContext_GetDoubleBufferState(
  129.     TQ3DrawContextObject        context,
  130.     TQ3Boolean                     *state);
  131.  
  132.  
  133. /******************************************************************************
  134.  **                                                                             **
  135.  **                            Pixmap Data Structure                             **
  136.  **                                                                             **
  137.  *****************************************************************************/
  138.  
  139. typedef struct TQ3PixmapDrawContextData {
  140.     TQ3DrawContextData        drawContextData;
  141.     TQ3Pixmap                pixmap;
  142. } TQ3PixmapDrawContextData;
  143.  
  144.  
  145. /******************************************************************************
  146.  **                                                                             **
  147.  **                        Pixmap DrawContext Routines                             **
  148.  **                                                                             **
  149.  *****************************************************************************/
  150.  
  151. QD3D_EXPORT TQ3DrawContextObject Q3PixmapDrawContext_New(
  152.     const TQ3PixmapDrawContextData    *contextData);
  153.  
  154. QD3D_EXPORT TQ3Status Q3PixmapDrawContext_SetPixmap(
  155.     TQ3DrawContextObject            drawContext,
  156.     const TQ3Pixmap                    *pixmap);
  157.  
  158. QD3D_EXPORT TQ3Status Q3PixmapDrawContext_GetPixmap(
  159.     TQ3DrawContextObject            drawContext,
  160.     TQ3Pixmap                        *pixmap);
  161.  
  162. #if defined(WINDOW_SYSTEM_MACINTOSH) && WINDOW_SYSTEM_MACINTOSH
  163.  
  164. /******************************************************************************
  165.  **                                                                             **
  166.  **                        Macintosh DrawContext Data Structures                 **
  167.  **                                                                             **
  168.  *****************************************************************************/
  169.  
  170. typedef enum TQ3MacDrawContext2DLibrary {
  171.     kQ3Mac2DLibraryNone,
  172.     kQ3Mac2DLibraryQuickDraw,
  173.     kQ3Mac2DLibraryQuickDrawGX
  174. } TQ3MacDrawContext2DLibrary;
  175.  
  176.  
  177. typedef struct TQ3MacDrawContextData {
  178.     TQ3DrawContextData            drawContextData;
  179.     CWindowPtr                    window;
  180.     TQ3MacDrawContext2DLibrary    library;
  181.     gxViewPort                    viewPort;
  182.     CGrafPtr                    grafPort;
  183. } TQ3MacDrawContextData;
  184.  
  185.  
  186. /******************************************************************************
  187.  **                                                                             **
  188.  **                        Macintosh DrawContext Routines                         **
  189.  **                                                                             **
  190.  *****************************************************************************/
  191.  
  192. QD3D_EXPORT TQ3DrawContextObject Q3MacDrawContext_New(
  193.     const TQ3MacDrawContextData    *drawContextData);
  194.     
  195. QD3D_EXPORT TQ3Status Q3MacDrawContext_SetWindow(
  196.     TQ3DrawContextObject        drawContext,
  197.     const CWindowPtr            window);
  198.  
  199. QD3D_EXPORT TQ3Status Q3MacDrawContext_GetWindow(
  200.     TQ3DrawContextObject        drawContext,
  201.     CWindowPtr                    *window);
  202.  
  203. QD3D_EXPORT TQ3Status Q3MacDrawContext_SetGXViewPort(
  204.     TQ3DrawContextObject        drawContext,
  205.     const gxViewPort            viewPort);
  206.  
  207. QD3D_EXPORT TQ3Status Q3MacDrawContext_GetGXViewPort(
  208.     TQ3DrawContextObject        drawContext,
  209.     gxViewPort                    *viewPort);
  210.  
  211. QD3D_EXPORT TQ3Status Q3MacDrawContext_SetGrafPort(
  212.     TQ3DrawContextObject        drawContext,
  213.     const CGrafPtr                grafPort);
  214.  
  215. QD3D_EXPORT TQ3Status Q3MacDrawContext_GetGrafPort(
  216.     TQ3DrawContextObject        drawContext,
  217.     CGrafPtr                    *grafPort);
  218.  
  219. QD3D_EXPORT TQ3Status Q3MacDrawContext_Set2DLibrary(
  220.     TQ3DrawContextObject        drawContext,
  221.     TQ3MacDrawContext2DLibrary    library);
  222.  
  223. QD3D_EXPORT TQ3Status Q3MacDrawContext_Get2DLibrary(
  224.     TQ3DrawContextObject        drawContext,
  225.     TQ3MacDrawContext2DLibrary    *library);
  226.  
  227. #endif /* WINDOW_SYSTEM_MACINTOSH */
  228.  
  229. #ifdef __cplusplus
  230. }
  231. #endif /*  __cplusplus  */
  232.  
  233. #endif  /*  QD3DDrawContext_h  */
  234.